<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Test extends Controller {

    public function action_index() {
        echo "test";
    }

    public function action_upload() {
        $url = "http://root:2124416@10.128.36.21/cgi-bin/video.jpg";
        $dir = URL::base()."/assets/videos/";
        $lfile = fopen($dir . basename($url), "w");

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)');
        curl_setopt($ch, CURLOPT_FILE, $lfile);

        fclose($lfile);
        curl_close($ch);
    }
}

?>
